
import { PayloadAction, createSlice } from "@reduxjs/toolkit";
import { produce } from "immer";


export type ServiveInfoType = {
    "chatid": string,
    "prologue"?: string
    "id": string,
    "nickname": string,
    "head": string,
    [key:string]:any
}

const ServiceInfoInitial:ServiveInfoType = {
    chatid:'',
    prologue:'',
    id:'',
    nickname:'',
    head:''
}

const ServiceInfoSlice = createSlice({
    name:'ServiceInfoSlice',
    initialState:ServiceInfoInitial,
    reducers:{
        setServiceInfo:produce((draft:ServiveInfoType,action:PayloadAction<ServiveInfoType>)=>{
            return action.payload
            
        })
    }
})

export const {setServiceInfo} = ServiceInfoSlice.actions

export default ServiceInfoSlice.reducer